const DataBase = require('./db/database');
const SysDao = require('./dao/sys');
const ServerDao = require('./dao/server');
const GroupDao = require('./dao/group');
const Mock = require('mockjs');

const db = new DataBase('./database.sqllite3');
const sysDao = new SysDao(db);
const serverDao = new ServerDao(db);
const groupDao = new GroupDao(db);

const sysData = {
    name: "display",
    ip: "192.168.3.1",
    port: "22",
    username: "weblogic",
    password: "weblogic1234",
    desc: "display weblogic服务器"
}

// for(let i=0; i<1; i++){
//     const data = Mock.mock({
//         name: '@word()',
//         ip: '@ip()',
//         port: '22',
//         username: '@word()',
//         password: '@word()',
//         desc: '@csentence()'
//     });
//     sysDao.insert(data).then((res) => console.log(res));
// }

// for(let i=0; i<5; i++){
//     const data = Mock.mock({
//         sysId: 2,
//         name: '@word()',
//         type: '@character("012")',
//         ip: '@ip()',
//         port: '22',
//         username: '@word()',
//         password: '@word()',
//         desc: '@csentence()',
//         shellpath: '@url()',
//         cachepath: '@url()',
//         grep: 'DserverId=display'

//     });
//     serverDao.insert(data);
// }

groupDao.insert({
    name: "analyze",
    desc: "数据分析系统"
});
